namespace iScadaFBD
{
    using System;
    using System.Drawing;

    [Serializable]
    public class SQR_FB : FBObject
    {
        public SQR_FB(Point point, DrawArea drawArea)
        {
            base.ObjName = drawArea.CreateObjName();
            base.InCount = 1;
            base.OutCount = 1;
            int width = 100;
            int height = (40 + (8 * Math.Max(base.InCount, base.OutCount))) + (8 * (Math.Max(base.InCount, base.OutCount) - 1));
            base.FBRect = new Rectangle(point.X, point.Y, width, height);
            base.FBType = GlobalParam.FBType.SQR;
            for (int i = 1; i <= base.InCount; i++)
            {
                string str = "IN_D" + i.ToString();
                InNodeObject obj2 = new InNodeObject(base.FBRect, i, str);
                base.InNodeList.Add(obj2);
            }
            OutNodeObject obj3 = new OutNodeObject(base.FBRect, 1, "OUT_D");
            base.OutNodeList.Add(obj3);
        }

        public override void Draw(Graphics g, DrawArea drawArea)
        {
            int num;
            base.DrawBackground(base.InCount, base.OutCount, g);
            for (num = 0; num < base.InNodeList.Count; num++)
            {
                InNodeObject obj2 = (InNodeObject) base.InNodeList[num];
                obj2.FBRect = base.FBRect;
                obj2.Draw(g, drawArea);
            }
            for (num = 0; num < base.OutNodeList.Count; num++)
            {
                OutNodeObject obj3 = (OutNodeObject) base.OutNodeList[num];
                obj3.FBRect = base.FBRect;
                obj3.Draw(g, drawArea);
            }
        }
    }
}

